import React, { PropTypes } from 'react';
import { Icon } from 'antd';
import styles from './detailPanel.less';

const DetailPanel = ({ title = '', children, onClickBack }) => {
  return (
    <div className={`${styles.detailPanel}`}>
      <div className={styles.detailClose} onClick={(e) => { onClickBack(e); }} >
        <Icon type="left" />
        <span>返回</span>
      </div>
      {children}
    </div>
  );
};

DetailPanel.propTypes = {
  children: PropTypes.any.isRequired,
  title: PropTypes.string,
  onClickBack: PropTypes.func,
};

export default DetailPanel;
